Spring Boot 2.0 Projects: Build production-grade reactive applications and microservices with Spring Boot by Mohamed Shazin Sadakath

Spring Boot 2.0 Projects: Build production-grade reactive applications and microservices with Spring Boot by Mohamed Shazin Sadakath

Author:Mohamed Shazin Sadakath [Sadakath, Mohamed Shazin]
Language: eng
Format: epub
Tags: COM060180 - COMPUTERS / Web / Web Services and APIs, COM051000 - COMPUTERS / Programming / General, COM051280 - COMPUTERS / Programming Languages / Java
Publisher: Packt Publishing
Published: 2018-07-29T23:00:00+00:00


innerFunction(o);

println("Outer Function $o");

println("Outer Function Variable $outerFunctionVariable");

}

The outer function can be invoked as follows:

outerFunction("Hello World!");

An inner function can never be invoked from outside its scope but can be accessed from inside it. Also, outer function local variables can be used by inner functions but not vice versa.

Default arguments in functions

Unlike Java function arguments, Kotlin supports default arguments in functions. This enables flexible function writing, as in the following code:

fun withDefaultValues(name : String = "Shazin", age : Int = 32) {

println("Name $name and Age $age");

}

The preceding function can be called as follows:

withDefaultValues();

withDefaultValues("Shahim", 32);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.